<?php
class Shape {
	private $width;
	private $height;
	protected $shapeType;

	public function __construct($width=0,$height=0) {
		$this->resize($width,$height);
		$this->shapeType = "Unknown";
		
	}

	public function resize($newWidth, $newHeight) {
		if ( $newHeight >= 0 && $newWidth >= 0) {
			$this->width = $newWidth;
			$this->height = $newHeight;
		}
	}

	public function getArea() {
		return $this->width * $this->height;
	}

	public function printInfo() {
		echo "This shape is " . $this->getShapeType() . " and has width = " . $this->width . " and height = " . $this->height ."<br/>";
	}
	
	public function getShapeType() {
		return $this->shapeType;
	}
	
	public function __get($field) {
		if ( property_exists($this, $field) ) {
			return $this->$field;
		}
	}

}
?>